﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Sublimation
{
    public class DrawableText
    {
        protected string message;
        public string Message {
            get { return this.message; }
            set { this.message = value; }
        }

        protected Vector2 position;
        public Vector2 Position
        {
            get { return this.position; }
            set { this.position = value; }
        }

        protected Color color;
        public Color Color
        {
            get { return this.color; }
            set { this.color = value; }
        }

        protected double expiryTimeRemainingMillis;
        public double ExpiryTimeRemainingMillis
        {
            get { return this.expiryTimeRemainingMillis; }
            set { this.expiryTimeRemainingMillis = value; }
        }

        protected double maxExpiryTimeMillis;
        public double MaxExpiryTimeMillis
        {
            get { return this.maxExpiryTimeMillis; }
            set
            {
                this.maxExpiryTimeMillis = value;
                this.expiryTimeRemainingMillis = value;
            }
        }

        public bool isAlive()
        {
            return this.ExpiryTimeRemainingMillis > 0;
        }

        protected float scale;
        public float Scale
        {
            get { return this.scale; }
            set { this.scale = value; }
        }

        protected float rotation;
        public float Rotation
        {
            get { return this.rotation; }
            set { this.rotation = value; }
        }

        public DrawableText()
        {
            Reset();
        }

        public void Reset()
        {
            this.message = "";
            this.position = Vector2.Zero;
            this.color = Color.White;
            this.MaxExpiryTimeMillis = 0.0d;
            this.scale = 1.0f;
            this.rotation = 0.0f;
        }

        public void SetAlpha(byte value)
        {
            this.color.A = value;
        }
    }
}
